﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PageMethodsDefault.aspx.cs" Inherits="Skynet.WebSite.Demos.PageMethodsDefault" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
   
</head>
<%--
<httpModules>
  <add name="ScriptModule"
     type="System.Web.Handlers.ScriptModule, System.Web.Extensions" />
</httpModules>--%>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
    </asp:ScriptManager>
     <script type="text/javascript">         
         function getTime() {
             PageMethods.GetTime(methodCompleted);
         }
         function methodCompleted(results, context, methodName) {
             // Format the date-time object to a more readable string
             var displayString = results.format("ddd, dd MMMM yyyy");
             $get("Label1").innerHTML = displayString;
         }
</script>
    <div>
        <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
        <input type="button" id="btnclick"  value="click" onclick="return getTime();"/>
    </div>    
    </form>
</body>
</html>
